package com.yeswater.redis7.controller;

import com.yeswater.redis7.service.OrderService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description:
 * @author： yeswater
 * @create： 2024/6/21
 */

@RestController
public class OrderController
{
	@Resource
	private OrderService orderService;
	
	@RequestMapping(value = "/order/add",method = RequestMethod.POST)
	public void addOrder()
	{
		orderService.addOrder();
	}
	
	
	@RequestMapping(value = "/order/{id}", method = RequestMethod.GET)
	public String findUserById(@PathVariable Integer id)
	{
		return orderService.getOrderById(id);
	}
}
